<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>XXX云信息系统</title>
    <link rel="stylesheet" href="../static1/frame/layui/css/layui.css">
    <link rel="stylesheet" href="../static1/frame/static/css/style.css">
    <link rel="icon" href="../static1/frame/static/image/code.png">
</head>

<body>

<!-- layout admin -->
<div class="layui-layout layui-layout-admin"> <!-- 添加skin-1类可手动修改主题为纯白，添加skin-2类可手动修改主题为蓝白 -->
    <!-- header -->
    <div class="layui-header my-header">
        <a href="index.html">
            <!--<img class="my-header-logo" src="" alt="logo">-->
            <div class="my-header-logo">XXX云信息系统</div>
        </a>
        <div class="my-header-btn">
            <button class="layui-btn layui-btn-small btn-nav"><i class="layui-icon">&#xe65f;</i></button>
        </div>

        <!-- 顶部左侧添加选项卡监听 -->
        <%--<ul class="layui-nav" lay-filter="side-top-left">--%>
            <%--&lt;%&ndash;<li class="layui-nav-item"><a href="javascript:;" href-url="demo/btn.html"><i class="layui-icon">&#xe621;</i>按钮</a></li>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<li class="layui-nav-item">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<a href="javascript:;"><i class="layui-icon">&#xe621;</i>基础</a>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<dl class="layui-nav-child">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<dd><a href="javascript:;" href-url="demo/btn.html"><i class="layui-icon">&#xe621;</i>按钮</a></dd>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<dd><a href="javascript:;" href-url="demo/form.html"><i class="layui-icon">&#xe621;</i>表单</a></dd>&ndash;%&gt;--%>
            <%--&lt;%&ndash;</dl>&ndash;%&gt;--%>
            <%--&lt;%&ndash;</li>&ndash;%&gt;--%>
        <%--</ul>--%>

        <!-- 顶部右侧添加选项卡监听 -->
        <ul class="layui-nav my-header-user-nav" lay-filter="side-top-right">

            <li class="layui-nav-item">
                <a class="name" href="javascript:;"><img src="../static1/frame/static/image/code.png" alt="logo"> ${admin.u_name}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" id="update-btn-pws"><i class="layui-icon">&#xe621;</i>密码修改</a></dd>
                    <dd><a href="user/exit"><i class="layui-icon">&#x1006;</i>安全退出</a></dd>
                </dl>
            </li>
        </ul>

    </div>
    <!-- side -->
    <div class="layui-side my-side">
        <div class="layui-side-scroll">
            <!-- 左侧主菜单添加选项卡监听 -->
            <ul class="layui-nav layui-nav-tree" lay-filter="side-main">

                <%--<c:forEach items="${menuList }" var="main">--%>
                <%--<div class="card-header" id="main-${main.menuId}">--%>
                <%--<a class="main-menu-item" style="cursor: pointer;" data-toggle="collapse"--%>
                <%--data-target="#sub-menu-${main.menuId}">--%>
                <%--${main.menuName }--%>
                <%--</a>--%>
                <%--</div>--%>
                <%--<div id="sub-menu-${main.menuId}" class="collapse" data-parent="#my-menu">--%>
                <%--<div class="card-body">--%>
                <%--<c:forEach items="${main.subMenuList }" var="sub">--%>
                <%--<a class="sub-menu-item" href="..${sub.menuUrl }"--%>
                <%--target="my-content">${sub.menuName }</a>--%>
                <%--</c:forEach>--%>
                <%--</div>--%>
                <%--</div>--%>
                <%--</c:forEach>--%>


                <c:forEach items="${menuList }" var="main">

                    <li class="layui-nav-item  layui-nav-itemed">
                        <a href="javascript:;"><i class="layui-icon">&#xe620;</i>${main.menuName }</a>
                        <c:forEach items="${main.subMenuList }" var="sub">
                            <dl class="layui-nav-child">
                                <dd><a href="javascript:;" href-url="..${sub.menuUrl }"><i
                                        class="layui-icon">&#xe621;</i>${sub.menuName }</a>
                                </dd>
                            </dl>
                        </c:forEach>
                    </li>
                </c:forEach>

            </ul>

        </div>
    </div>
    <!-- body -->
    <div class="layui-body my-body">
        <div class="layui-tab layui-tab-card my-tab" lay-filter="card" lay-allowClose="true">

            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="1"><span><i class="layui-icon">&#xe638;</i>欢迎页</span></li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe id="iframe" src="../static1/demo/welcome.html" frameborder="0"></iframe>
                </div>
            </div>

        </div>
    </div>
    <!-- footer -->
    <div class="layui-footer my-footer">

    </div>
</div>


<!-- 右键菜单 -->
<div class="my-dblclick-box none">
    <table class="layui-tab dblclick-tab">
        <tr class="card-refresh">
            <td><i class="layui-icon">&#x1002;</i>刷新当前标签</td>
        </tr>
        <tr class="card-close">
            <td><i class="layui-icon">&#x1006;</i>关闭当前标签</td>
        </tr>
        <tr class="card-close-all">
            <td><i class="layui-icon">&#x1006;</i>关闭所有标签</td>
        </tr>
    </table>
</div>



<%--修改密码弹框--%>
<div style="padding: 5px;display:none" id="div-update-user">
    <form class="layui-form" lay-filter="form-update-user" method="post" action="user/update">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="hidden" value="${admin.u_id}" name="u_id" required lay-verify="required"
                       placeholder="请输入花色ID" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="text" name="u_pwd" required lay-verify="required"
                       placeholder="请输入用户新密码" autocomplete="off" class="layui-input">
            </div>
            <!-- <div class="layui-form-mid layui-word-aux">花色名字验证</div> -->
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="submit" class="layui-btn" value="提交">
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>


<script src="../static/js/jquery-3.3.1.min.js"></script>
<script src="../static/js/sweetalert-2.1.0.min.js"></script>
<script type="text/javascript" src="../static1/frame/layui/layui.js"></script>
<script type="text/javascript" src="../static1/frame/static/js/vip_comm.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript">
   /*  layui.use(['layer','vip_nav'], function () {
        // 操作对象
        var layer       = layui.layer
            ,vipNav     = layui.vip_nav
            ,$          = layui.jquery;
        // 顶部左侧菜单生成 [请求地址,过滤ID,是否展开,携带参数]
        vipNav.top_left('./json/nav_top_left.json','side-top-left',false);
        // 主体菜单生成 [请求地址,过滤ID,是否展开,携带参数]
        vipNav.main('./json/nav_main.json','side-main',true);
        // you code ...
    }); */


    $("#update-btn-pws").click(function () {
        swal({
            title: "你确定要修改密码吗？",
            text:"密码一旦修改将要重新登录",
            icon: "warning",
            buttons: ["取消", '确定'],
            dangerMode: true,
        })
            .then(function (ok) {

                if (ok) {
                    //执行异步请求
                    layer.open({
                        type: 1,
                        title: '用户修改信息',
                        area: ['700px', '600px'],
                        content: $('#div-update-user') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                    });
                }
            })
            .catch(function (err) {
                console.log(err);
                if (err) {
                    swal("操作失败!", "请于管理员联系。", "error");
                }
            });




    });

</script>
</body>
</html>